var frslib=frslib||{};frslib.global=this;frslib.isDef=function(val){return val!==undefined};frslib.exportPath_=function(name,opt_object,opt_objectToExportTo){var parts=name.split('.'),cur=opt_objectToExportTo||frslib.global;if(!(parts[0]in cur)&&cur.execScript)cur.execScript('var '+parts[0]);for(var part;parts.length&&(part=parts.shift());)if(!parts.length&&frslib.isDef(opt_object)){cur[part]=opt_object}else if(cur[part]){cur=cur[part]}else cur=cur[part]={}};frslib.provide=function(name){return frslib.exportPath_(name)};frslib.provide('frslib.htmlforms');(function($){frslib.htmlforms.writeValueToCode=function($selector){$selector.find('input').each(function(){var val=$(this).val();$(this).attr('value',val);if($(this).attr('type')=='checkbox'){var checked=$(this).is(':checked');if(checked){$(this).attr('checked','checked')}else{$(this).prop('checked',false);$(this).removeAttr('checked')}}})}})(jQuery);frslib.provide('frslib.callbacks');(function($){frslib.callbacks.functions=Array();frslib.callbacks.addCallback=function(eventName,callback){frslib.provide('frslib.callbacks.functions.'+eventName);frslib.callbacks.functions[eventName]=new Array();frslib.callbacks.functions[eventName].push(callback)};frslib.callbacks.doCallback=function(eventName){if(!(eventName in frslib.callbacks.functions))return false;var newArguments=Array();for(var argumentsKey in arguments)if(!Number.isNaN(argumentsKey)&&argumentsKey>0)newArguments[argumentsKey-1]=arguments[argumentsKey];var output={};for(var key in frslib.callbacks.functions[eventName])output[key]=frslib.callbacks.functions[eventName][key].apply(this,newArguments);return output};frslib.callbacks.callAllFunctionsFromArray=function(arrayOfFunctions){var newArguments=Array();for(var argumentsKey in arguments)if(!Number.isNaN(argumentsKey)&&argumentsKey>0)newArguments[argumentsKey-1]=arguments[argumentsKey];var oneFunction;if(arrayOfFunctions)for(oneFunction in arrayOfFunctions)if(arrayOfFunctions[oneFunction])arrayOfFunctions[oneFunction].apply(this,newArguments)}})(jQuery);frslib.provide('frslib.colors');frslib.provide('frslib.colors.convert');frslib.provide('frslib.colors.type');(function($){frslib.colors.convert.hexToRgb=function(hex){var result=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);return result?{r:parseInt(result[1],16),g:parseInt(result[2],16),b:parseInt(result[3],16)}:null};frslib.colors.convert.hslToRgb=function(h,s,l){var r,g,b,m,c,x;if(!isFinite(h))h=0;if(!isFinite(s))s=0;if(!isFinite(l))l=0;h/=60;if(h<0)h=6-(-h%6);h%=6;s=Math.max(0,Math.min(1,s/100));l=Math.max(0,Math.min(1,l/100));c=(1-Math.abs((2*l)-1))*s;x=c*(1-Math.abs((h%2)-1));if(h<1){r=c;g=x;b=0}else if(h<2){r=x;g=c;b=0}else if(h<3){r=0;g=c;b=x}else if(h<4){r=0;g=x;b=c}else if(h<5){r=x;g=0;b=c}else{r=c;g=0;b=x};m=l-c/2;r=Math.round((r+m)*255);g=Math.round((g+m)*255);b=Math.round((b+m)*255);return{r:r,g:g,b:b}};frslib.colors.convert.rgbToHsl=function(r,g,b){r/=255,g/=255,b/=255;var max=Math.max(r,g,b),min=Math.min(r,g,b),h,s,l=(max+min)/2;if(max==min){h=s=0}else{var d=max-min;s=l>0.5?d/(2-max-min):d/(max+min);switch(max){case r:h=(g-b)/d+(g>6,0x80|cc&0x3f)}).replace(/[\u0800-\uffff]/g,function(c){var cc=c.charCodeAt(0);return String.fromCharCode(0xe0|cc>>12,0x80|cc>>6&0x3F,0x80|cc&0x3f)});return strUtf},decode:function(strUtf){var strUni=strUtf.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,function(c){var cc=((c.charCodeAt(0)&0x0f)<<12)|((c.charCodeAt(1)&0x3f)<<6)|(c.charCodeAt(2)&0x3f);return String.fromCharCode(cc)}).replace(/[\u00c0-\u00df][\u0080-\u00bf]/g,function(c){var cc=(c.charCodeAt(0)&0x1f)<<6|c.charCodeAt(1)&0x3f;return String.fromCharCode(cc)});return strUni}};while(i<256){var c=String.fromCharCode(i);a256+=c;r256[i]=i;r64[i]=b64.indexOf(c);++i} function code(s,discard,alpha,beta,w1,w2){s=String(s);var buffer=0,i=0,length=s.length,result='',bitsInBuffer=0;while(i=w2){bitsInBuffer-=w2;var tmp=buffer>>bitsInBuffer;result+=beta.charAt(tmp);buffer^=tmp<0)result+=beta.charAt(buffer<<(w2-bitsInBuffer));return result};var Plugin=$.base64=function(dir,input,encode){return input?Plugin[dir](input,encode):dir?null:this};Plugin.btoa=Plugin.encode=function(plain,utf8encode){plain=Plugin.raw===false||Plugin.utf8encode||utf8encode?UTF8.encode(plain):plain;plain=code(plain,false,r256,b64,8,6);return plain+'===='.slice((plain.length%4)||4)};Plugin.atob=Plugin.decode=function(coded,utf8decode){coded=coded.replace(/[^A-Za-z0-9\+\/\=]/g,"");coded=String(coded).split('=');var i=coded.length;do{--i;coded[i]=code(coded[i],true,r64,a256,6,8)}while(i>0);coded=coded.join('');return Plugin.raw===false||Plugin.utf8decode||utf8decode?UTF8.decode(coded):coded}}(jQuery));